home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp48_2 / areuh.tar / areuh / dump / common.h < prev    next >
C/C++ Source or Header  |  1990-10-10  |  4KB  |  125 lines

  1. /*
  2.  * Authors :
  3.  *   Pierre DAVID (pda@masi.ibp.fr or pda@frunip62.bitnet)
  4.  *   Janick TAILLANDIER
  5.  *
  6.  * This program can be freely used or distributed as long as this
  7.  * note is kept.
  8.  *
  9.  * This program is provided "as is".
  10.  */
  11.  
  12. #include <stdio.h>
  13.  
  14.  
  15. #define MAXLEN 256
  16. #define EOL    '\0'
  17. #define LBLLEN 12
  18.  
  19. /******************************************************************************
  20.  TYPE DEFINITIONS
  21. ******************************************************************************/
  22.  
  23. typedef long int saddr ;          /* Saturne address. At least 32 bits   */
  24. typedef unsigned char uchar ;          /* unsigned characters, for accents    */
  25. typedef short int sint ;          /* 16 bits */
  26.  
  27. /******************************************************************************
  28.  MAGIC NUMBERS
  29. ******************************************************************************/
  30.  
  31. #define  AL_MAGIC 0x1b080100          /* ... areuh_lex */
  32. #define  AO_MAGIC 0x1b0d0100          /* ... areuh_output of assembler */
  33. #define ALF_MAGIC 0x1b080100          /* first version of object file format */
  34. #define AOF_MAGIC 0x1b0d0100          /* first version of object file format */
  35.  
  36.  
  37. /******************************************************************************
  38.  USAGE TYPES IN .ao FILES
  39. ******************************************************************************/
  40.  
  41. #define XABSL 0x10     /* absolute reference */
  42. #define XABSO 0x20     /* absolute reference, with one bias */
  43. #define XRGTO 0x40     /* relative reference, goto type */
  44. #define XRGSB 0x80     /* relative reference, gosub type */
  45.  
  46.  
  47. /******************************************************************************
  48.  LABEL VALUES IN .ao FILES
  49. ******************************************************************************/
  50.  
  51. #define LBL_UDF -1L
  52.     /* label not declared (implicit or explicit) <=> only used */
  53. #define LBL_IVL -2L
  54.     /* invalid label (invalid expression for an EQU during pass one) */
  55. #define LBL_EXT -3L
  56.     /* external label not defined here (or yet) */
  57. #define LBL_XEQ -4L
  58.     /* global label which is defined here, with an external reference */
  59. #define LBL_SEQ -5L
  60.     /* local label which is defined with an external reference */
  61.  
  62.  
  63. /******************************************************************************
  64.  LABEL TYPES IN .ao FILES
  65. ******************************************************************************/
  66.  
  67. #define LUDF 0
  68.     /* undefined type (external label) */
  69. #define LABS 1
  70.     /* absolute local label (declared explicitly, with constants) */
  71. #define LREL 2
  72.     /* relative local label (declared implicitly, or explicitly with at least
  73.        one relative) */
  74.  
  75.  
  76. /******************************************************************************
  77.  VALUES RETURNED BY EXPRESSION EVALUATOR
  78. ******************************************************************************/
  79.  
  80. #define EXP_ERR -1L
  81. #define EXP_EXT -2L
  82.  
  83. extern int relabs ;
  84. extern uchar extexp[] ;
  85.  
  86. #include "err.h"
  87. extern void error () ;
  88.  
  89. #define hex5(str,val) format_hex (str, val, 5) ;
  90. #define hex6(str,val) format_hex (str, val, 6) ;
  91.  
  92. /******************************************************************************
  93.  MACHINE DEPENDANCIES
  94. ******************************************************************************/
  95.  
  96. #define HPUX             1
  97. #define ATARI_LATTICE         0
  98. #define PC_MSC             0        /* PC (beuark, Microsoft C) */
  99.  
  100. #if HPUX
  101. extern void format_time(), load_file() ;
  102. #define HP71EP "hp71.ep"
  103. #define RAO_MODE "r"
  104. #define WAO_MODE "w"
  105. #define skip(fp)
  106. #endif
  107.  
  108. #if ATARI_LATTICE
  109. extern void format_time(), load_file() ;
  110. #define HP71EP "hp71.ep"
  111. #define RAO_MODE "rb"
  112. #define WAO_MODE "wb"
  113. extern char skipvar ;
  114. #define skip(fp) fread(&skipvar,1,1,fp) ;
  115. #endif
  116.  
  117. #if PC_MSC
  118. extern void format_time(), load_file() ;
  119. #define HP71EP "hp71.ep"
  120. #define RAO_MODE "rb"
  121. #define WAO_MODE "wb"
  122. extern char skipvar ;
  123. #define skip(fp) fread(&skipvar,1,1,fp) ;
  124. #endif
  125.